package org.feiye.studyday25.review;

import java.io.*;

public class WriterTest {

	public static void main(String[] args) {
		// 字符输出流写东西进文件（以指定编码格式）
		OutputStream o = null;
		Writer r = null;
		try {
			o = new FileOutputStream("F:\\Java课件\\1.Java语言基础\\java_homework\\第一章\\java-basic-1-作业.txt", true);
			r = new OutputStreamWriter(o, "gbk");
			r.write("\n\n我爱java");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (r != null)
				try {
					r.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			if (o != null)
				try {
					o.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
		}

	}

}
